Improved json deserialization