clean up filter javascript