Improve attachments performance