Updating code to use "var" when possible