remove cruft and improve 2.6 compatibility