remove superfluous code from closest