cut the whole code in separated functions
modify consolidation enfine before test it, and add some libraries for asynchronous engines