I understand the problem that the intensity measure types of the hazard are stored in to two different fields, so here you are getting them by union. Could you move this logic into a method of HazardCalculation?