Update to parse function to remove foreign code