Cleanup

Refactor. A bit easier to maintain.