implement splitdataset and refactor validation method accordingly