refactoring ruby console