better clearing logic for conditional containers