use a multimethod for command dispatch