reordering and redesigning database