Move CLI to a separate class.