Attachment class refactoring