beautiful refactoring