Added method serialization.