Some refactor and test for splitting numbers