Merge CG's initial refactor