add tooltip and remove useless code