Moving to centralized DB operations.
Fix messed up stuff.