Moves deserialization into separate method.