refactor getIdForEmail into another method to be used by other modules