Tidying up Code