server code structure reorganization