Move filter_contents to plugin system