Exercise 3.5.2 Remove repetition in spec