Tidied up DB USE code.