centralized redis code