Extract common filtering to the base class.