re #2 drafted helper methods to generate C boilerplate code