Refactored batch cmd's into helper library