Rewrite for CLI