refactoring set_attachments interface