[refac] tooltip's code reorganised