Added tests, refactored tests.