Refactor to move prov stuff to coreprov.c (3/4)