Lots of refactoring necessary, just rushing to try this :)