refine the code of transcoder