support serialize variables from trait.