Refactor filterView method.