refactor rails redis usage