const timeOptions =
  [ 'morning',
    'afternoon',
    'evening'
  ]

const dayOptions =
  [ 'mon',
    'tues',
    'wed',
    'thurs',
    'fri',
    'sat',
    'sun',
    'any'
  ]

const getRadioButtonPair = (timePeriod) => {
  let radioButtonPair = {}
  radioButtonPair.button = document.querySelector(`[${timePeriod}]`)
  radioButtonPair.radio = document.querySelector(`[${timePeriod}-radio]`)
  return radioButtonPair
}

const timePairs = timeOptions.map(getRadioButtonPair)
const dayPairs = dayOptions.map(getRadioButtonPair)

const setTimeHandlers = ({ button, radio }) => {
  if (button) {
    button.addEventListener('click', () => {
      radio ? radio.click() : null
    })
  }
}

const addListeners = () => {
  timePairs.map(setTimeHandlers)
  dayPairs.map(setTimeHandlers)
}

export default addListeners

@@ -184,34 +184,193 @@
 %0A%0Aconst 
-getRadioButtonPair
+setEventListener = (%7B button, radio %7D) =%3E %7B%0A  if (button) %7B%0A    button.addEventListener('click', () =%3E %7B%0A      radio ? radio.click() : null%0A    %7D)%0A  %7D%0A%7D%0A%0Aconst addEventListeners
  = (time
@@ -558,389 +558,142 @@
 )%0A  
-return radioButtonPair%0A%7D%0A%0Aconst timePairs = timeOptions.map(getRadioButtonPair)%0Aconst dayPairs = dayOptions.map(getRadioButtonPair)%0A%0Aconst setTimeHandlers = (%7B button, radio %7D) =%3E %7B%0A  if (button) %7B%0A    button.addEventListener('click', () =%3E %7B%0A      radio ? radio.click() : null%0A    %7D)%0A  %7D%0A%7D%0A%0Aconst addListeners = () =%3E %7B%0A  timePairs.map(setTimeHandlers)%0A  dayPairs.map(setTimeHandl
+setEventListener(radioButtonPair)%0A%7D%0A%0Aconst addListeners = () =%3E %7B%0A  timeOptions.map(addEventListeners)%0A  dayOptions.map(addEventListen
 ers)

Refactor callback.js