reorganized settler.js file