WIP rewriting document filter