dry + function style fix
Merge pull request #214 from kevinb7/issue-203

issue 203 addendum: dry + function style fix