1. command line mode
2. simplify logic