Crack at DRYing it up a bit