select_* refactoring