cleaning up server.R