improve tooltips and format code