tidied up html events and ting