move get_pts function to avoid useless declaration