make headNode local and remove visibility trick, that we don't need anymore
keep var outside of loops
move fireLocalizedEvent to retranslate