Move conditional logic into helper