refactor to express server