smarter clearing of filter. use type instead of instance