refactor to use sequelize