Refactor CLI class and add bad symbol handling.