refactored splitter.py