remove unused temp variable
use more consistent variable names
add docstring for old provider insertion function