Updated filter to use input for filter type.