Group some kinds of execution

Additional optimization the threading