Remove all the sync function calls and use tmp file for go file