refactor some conditional logic to audio service