further rearrangement of the code