Refactor mailchimp code and improve test suite