javascripts deferred and optimized