select refactoring