Server-side code cleanups