Refactoring code and project structure (testing)