Cleaned up CLI code.