DRYing up code a little bit