Use an array instend of switch for comparing extensions