move filter functions to parent scope (mainCtrl)