split add attach functions