cancel menu refactoring: it should be usable from external plugins