remove unused tables.js
clean up code, add submit event