[json] cleaner logic'