Refactor Triangle