changed code (with previous db / source ref changes by gw)