sort the result based on instance types