Moved index.js to lib/model.js