Modified regionManager.js file to be more readable