code cleanup, protected serialization