WIP Massive refactor