Added ruby refactoring