some cleanups (ugh, old code)
merge with master
Merge pull request #1 from johannhof/master

master