Remove function from global scope. Simplify code
Remove function from global scope. Simplify code

MergeMyPullRequest/order-splitter,MergeMyPullRequest/order-splitter,billy-hardy/order-splitter,billy-hardy/order-splitter