Rearranging the code