refactor clickElement() to fix gladbooks/#110