Move fetching logic to render.js