@classmethod
def storage_factory(cls, prefix, storage_cls=None, storage_uri=None):
    """
        A little magic here, it's better to cache storage instances using class name and url,
        but we don't need it anyway.
        """
    key_prefix = '{}_{}_'.format(cls.__name__.upper(), prefix.upper())
    attr = '_{}_storage'.format(prefix)
    if not storage_cls and not storage_uri:
        if not hasattr(cls, attr):
            setattr(cls, attr, cls.storage_cls(cls.storage_uri, key_prefix))
        return getattr(cls, attr)
    return (storage_cls or cls.storage_cls)(storage_uri or cls.storage_uri,
        key_prefix)
