some improvements with jquery