REFACTORING: Fixed code style nits and extracted the null values check to a method.