refactor schemas.js and rename to models.js