Some more code for splitting... in some serious need of refactoring