Refactor code to match changes to emailcommon

* No changes in functionality

Change-Id: I744bc0a0ff0bddea2e91ee9f307c98960848eb68
6 files changed