a few minor refactorings from luketower's feedback
Merge pull request #6 from Nissl/mod2

a few minor refactorings from luketower's feedback