[refactor][xs]: move model to lib/model.js.