restructure server and sim code into server ns