Need to check that attachments still work this way after the refractor ... this function and the next