Creating menu bar via dependency injection