Separated handler logic to allow reloading during requests; Set up state management on client and serialization function.