Finish DB implementation.