Tidying up source code