Massive refactor: WIP
Refactored!