Add const for contract_type and add HTMLPurifier