refactor selector