remove and optimize