Major refactoring, to improve filter-chaining and further perf enh.