Clean up and refactor max point on a line