code guidelines, remove unused variables, pass more info to click-handler