little toolbar html/js refactoring