Tidying up file contents