add some cmd commands & refactoring