Big refactoring
WIP
WIP