Refactored redundant code.
Unit tests for refactored exception handling code
Merge pull request #65 from opscode/ameya-service-refactor

Refactored redundant code.