refactor triangle project