refactor doClick