deserialization refactoring