Move function main() to generated helper file