Finish database part