Triangle identifier refactored with objects