Create a constant array containing ordering of the extensions instead of hard coding it directly in the function.