DRYed code