Improve JSON serialization to remove condition type serialization when serialization a condition