exercises 5.1, 5.2, 5.3: refactor specs