Tree Ranges to cleanup code