major refactoring due to namespace changes and psr separation