Refactor and rename last-line-number to total-lines.