Refactor template state into a module.
Refactor showHex function into Core module.