Refactored the splitter