Play with the code order so that memory management is cleaner.