Fix to comply with changes in cpf and refactored