factored out tree tests