Changed Command constructor to use CommandType