[C_Hat] - Refactor all code.