Compare

This sort of logic could be extracted into a module.