extracted redis impl from core.