Move filter dance into if()