improve the db refresh process