Refactor to allow accessing attachment objects directly from models.