reorder js for performance