Refactored the determination of the measurement lines