minimize variable scope