Ex. 6 - final Code refactoring