Refactor AttachmentsController to remove helper

The helper is going to be removed in a future commit.