improved loading speed for domcontentloaded and load events