Move splitData function

Moved the splitData function to where it need to be.