refactored to use a hash in redis