Greatly simplified server code