exercises
midterm refactor