support for selectors in template option, small improvements