pi: refactor: replace arrays by points and vectors