replace some code with the :empty pseudo-class