(refactor) clean up server.js