DRYing out some WET code