Added unit tests, refactoring