to optimize code in jq-edit.ejs