select refactor