Quick refactorings

Just some easy refactoring to help with legibility
Update codegen.hs
Merge pull request #2 from Cipherwraith/patch-2

Quick refactorings