simulating dynamic dispatch