refactor index.js files to expose just one method