Update to improve modularity and improve the forest size optimisation