Utility methods for creating tree structures.