Refactor Command Line Interface