Deserialize refactored into static method.