first batch of exercises Chapter 2, refactored in a package