ensured resources sort order, using same tempalte for list and map