Refactor of queryArgs.activeGroup -- it is a bit better now, still not perfect
Improvement in resetState because of refactor