ruby refactoring rf