Tidy up of the codebase