changed jquery cdn and refactored front code