Improved handler selection