Added selectTemplate and interface for escape functions