refactor cmi