reduced the use of var === undefined