Refactor of spliter and merger