make it possible to handle control and menu callbacks more dynamically.