No, this is way harder to understand because you are mangling a dict into the function parameter. I'm even not clear how you differentiate between different message type this way. I think we should really have a single self.on() method with switch message.type.