Cleaning up the serverside code.