QueryBuilder: Move declaration of external variables after namespaces declarations