minor fix

* update comments
* update formatting
fix the registration order of observers

* first ensure the existence of the tooltip container, then register observers
  for handling the tooltip