Refactoring ruby editing