Rewriting the engine to support concurrency