change some code to plain server