Fix: optimization and move some js in footer