Seperate code generator into several smaller functions.