move variable closer to usage