started DRYing up code