a small refactoring to make this more widely usable
Merge pull request #6 from mcmakev/master

a small refactoring to make this more widely usable