refactors filter_args