Much of this code is the same as the other one - can we refactor this and just have an abstract method like preSplit() that does what you do above?