refactor in dbAssist.js and server.js