refactored files to pass js code sniffer