Refactoring challenge solution