did more DRYing up of code