Convert filters to factory design pattern