Move branch grid code out of electrical package