cleaned up models.js a bit