better try catch
Merge pull request #2950 from dimagi/refactor

minor user refactorings