more shuffling tests around and refactoring