I would have used isinstance, but I was following your _decode method in the Commands class, which uses type. I can fix.