Remove obsolete code from tree