Rename functionToCBuffer2 to something sensible and move it inside the visitor class