WIP
Refactor
Big refactor