Refactoring the Attachment helpers