continue to refactor Template Manager.