Declare var closer to site of first use

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>