beautify the filter functionality