Added support for query and keys filtering