Fixed some small bugs + Major cleanup and refactoring for toolbar