store build_nested_query method