refactor base nodejs server