Toolbar buttons creation logic refactoring.