lo: extract common code from filter and dialog to base