WIP Refactoring architecture