Improve the db usage, fix the TP