minor rearrangement, prefer to use local variable