Filtering both via average and maximum.