Improved part detection