Right way to do JS by refer to external JS files