Take out content-type logic from view to helper