Refactor redis access routines