Can't this just be based on require('models')(sequelize, config); ?