splitArguments made more functionally pure