1) using .build to create eligibility_determination.
2) code cleanup
added sanitize_type() to handle empty type
added exception handling and logging