Shuffling some code around