move code for fixing overlapping members to seperate function