refactor Selector class