Tidied
Tidying and refactoring