WIP - Refactor greatly