Move filtering to own preprocessing file