rename _cmd method to cmd