Cleaned server code