Extract deserialization from the client side to the lib side