Tidy up the codebase