toy refactoring