pie and histogram cleanup