Pattern 2 and 3 - Extract Queries and Policies