fixed unit tests and refactored code