Wip.
Refactoring.