[PATCH v2 0/2] refine and clean code for synchronous mode