refactored types out
refactored redis code