Normalize query