refactored toolbar code again