minor refactoring and docs, closes #11 and #8