REFACTOR: cleanup charGen and add comments