Refactored conditional_fields implementation.