[PATCH v3 0/3] refine and clean code for synchronous mode