Remove some code duplication when refreshing work packages