move splitting code