Changes: code refactoring (checking for null variables).