Selector code clean up