refactoring: select+first = detect