Code Refactoring and Tidying