Further simplify exercise 3.28 solution