CLean up the redundant code of dynamic parallelism