version
reduce setImmediate usage
simplify global usage