changed schema and made more modular