Refactor the selector