DRYs up my code