removed long switch statement from main.js and default.js files And replaced with simpler logic