Feature/major refactoring