(refs #12) Created the helper of the attachment function.
(refs #12) Modified to use the helper of the attachment.