generic type parameter T causes internal error in VM so use a 'dynamic duck'