Refactored out duplicate logic
Merge pull request #2 from wallner/refactorRequestMethod

Refactored out duplicate logic