clean up some duplicate code
Merge pull request #4 from bypasslane/jspies/dupe-refactor

clean up some duplicate code