Convert the original scaffold code into a serializer, so that the analysis object can be reused.