Drying up code - removing repetition