restructuring and using strict mode of javascript