major refactoring to reuse control bar