Refactoring Ordered batch execution to match model of the shell and simplifying the codE