remove unused code and filter lines, and move to new Filter code