style: move var init below validity test

move initializing additional vars after test
for valid word candidate