Refactored CodeGenerator and removed old styles