Removed redundant tests
Tidied code