more encapsulation in saveAttachments