first refactor
second refactor: removed domain-email-pattern reference method. added check for success of get_pattern method
removed unnecessary conditional from get_pattern
added test suite