Tidied up code and removed unused tests. added code climate test coverage