Refactor using delegate for menu bar and configsheet