I replaced it all with `var $form = $('#filter');`
I generally don't like using IDs but I guess in this case it's ok since it's so unlikely that there'll be more than one.