Separating functionality and argument parsing to allow calling the grid-splitting function from other modules