Refactored to. Attachments working