Refactoring some more, with a little help from the solutions page