move generator_source to a separate header