Change codegen from a function to a module with a parse function inside