refactor the toolbar_link method to reduce complexity