Factor Choice, Production, and Provision of Safety by the Firm