Refactor and simplify the command line and config