Add URL check for optimize attributes
Rearrange some code
Changed reorder method : 10 times faster but bugs...