Refactor selectExits().