Toolbox: refactor opening to event based functionality