refatory all datbase