Initial implementation of filtering.