Extract out reverse extname function