optimize filters tree