refactored tree types