[Perf] Removed code related to calculating $commonCUsAncestor; filtering now uses $document directly
[Perf] Small perf improvements + removed some comments