reordering external elements for speed