reorder the imported js and fix minor issue