tidying up, and last commit before refactoring round 2