reorganize db setup