cleanups and small improvements to filters