Exactly it seems like you could replace all this code with:<p>send(&quot;#{group.type}_notification&quot;) or its python equivalent.<p>Maybe a hash table with strings as keys and functions as values for a less &#x27;scripty&#x27; language.<p>Perhaps I&#x27;m thinking the variable group is of type group, but it also looks like it suffers from poor separation of concerns... eg. Why are groups sending email?<p>Probably also a good candidate for guards instead of nested ifs