refactored using null object pattern