Minor: use switch to make it clear we have 4 cases
Minor: remove dead code
Attachment holds a value, fixes #1482