refactor get_current_selection