WIP: First refactorings