Remove jQuery dependency for main function