Refactor function to read and parse point coordinates