Add filtering mode interface to main and library