ENH+FIX: big cleanup

ENH+FIX: big cleanup2