Reorganizing methods in js/setup.js