Shortens editTable.js.coffee and throws repetitive code into functions