move filtering into panel.js