Refactor exercises from chapter one