use setImmediate in a heavy procedure

extractData is too heavy so now I modified it to an async method.