added data separation helper function