Refactor splitting to helper