attachments refactored