I deliberately left refactoring to it's own pull request.