General refactoring

Focusing on a re-organization and more functional aspects