Refactor

I've done a lot here and I'm not finished.
Please review say if this direction is okay.

If yes, we finally should add tests for that stuff and merge it if all parts are tested.

*ping* @elmarburke