[major] add optimize back in and fix all the tests, rename traverse to children