change js order
clean the obsolete code