Let's pull this attachments assignment into a method as well, so that we don't assign by ternary operation.