Add and refactor tests from exercise 5.6