the basics for client-side filtering + a few tweaks