Handling bangs and queries