refactored top-bar directive