Simplified setup.js and moved common methods into utils.js