refactoring, improved namespaces and project structure