tuning running time and loop counts.
eliminate template syntax.
add some switch conditions.
extend timeout to arount 5 minutes.