refactor empty selectors code