Improved identification of breakpoints in piecewise regression and its applications