refine server, add comments