This is another case where I think we should consider just making a template for the following bit of logic.