updates to server logic for easier maintenance