refactor scgi server