DB access refactored.