Move beginPostProcess into separate function to be called by report api,
note that this fn may be renamed