clean some code in the merger