move filter functions to controller