Some optimization to the automate_selection option