Merge pull request #26 from Mause/master

Lots of small refactors