Use gb_trees rather than dict for performance.