refactored to be simpler
Merge pull request #2 from dimagi/refactor

refactored to be simpler