Move model code in triangle.go