removed unused functions
implemented filter selection on query and filter