reorganize db stuff