Support polymorphism in activity definition