remove unused and confusing code