Restructure schema and models