WIP of refactoring
Refactor done