Selective removal of parts of the layer