refactored checking of  default value