DRY up some functions
Merge pull request #16 from eapache/dry

DRY up some functions