Use "let" instead of "var" in appropriate places