refactoring 3D point arrays