Sharpened logic for handling attachments