Solution for 14
Refactoring