refactoring and fixing some issues with the redis package