move output filtering function to bootstrap