move toolbar handling to its own class