Improvements to the selector template