Cartesian closed categories of internal categories