added tests and refactored project structure