Restructure and redesign database schema