cleaned code based on .jshintrc