refactor tree total size