Xrf data

Some small modifications.
We don't need to worry about the memory at this moment, but I am afraid we generate redundant code?