move event table to own function called from index.html