revise command processing. Add some class processing (add, check existence)