Code review and refactoring of title bar