shuffling code for reusability