Refactor shuffling