Code Tidied Up