Added some modifications and generalization to muster batch builder script