Less duplicate code in worldregen paste