Improved taxonomy filter function so it integrates with standard filters