Polish up server code