refactor shuffe method