Update refresh script to handle environment.