oop tree refactor