a few minor refactorings from luketower's feedback

forgot to include this in the branch before merging it