ENG-6857: refactor out decision making in one place.