Refactored TitleBarViewManager to be more readable