Extracted toolbar logic to a component. Cleaned up.