Refactoring to have the same behavior as in
SelectComponentOptionCompleter