refactor compose mail method