Refactoring hiredis protocol