move included scripts to the top and make them deferred where possible