Refactored into cmd based tool