factored out all the attachment methods into oag gem