Adds option to generate commands to push batch components and refactors code