modified filter and notFilter to prevent use of asInstanceOf
update for modified TemplateTable, specific: filter and filterNot