In this function and several others, can we do the imports at the top rather than inside the functions?