Added tests
Refactored tests
Refactoring
bug fixes