Put clickhandler in it's own named function