Merge pull request #38 from Mause/develop

Refactor some code