Re-factoring: extracted the code responsible for interacting with GMail into a separate object