externalizing db resources