Improved extension matching