refactored to example.js