Is this function too oversized (110 lines) - would it be simpler as separate provision_homestead_cache and provision_homestead_provisioning ? It doesn't look like that would involve very much code duplication. I guess it does increase the risk that the two would get out of sync, which might be nasty.