refactoring attachment from string type to class Attachment
comment: // TODO: remove Note class if not used