reforgonize server code