Refactored DB usage.