Simplify tests for triangle type, move them into kind function