add Commandtool and Refactoring