DRYing up some code.