Use custom serialization templates instead of reflection.