changed interface and added cmd support