Added tests
Refactored tests