refactor weixin code