Clean some code during join process