refactor some command