Moved database implementations into handlers.