Finished refactoring and made a couple of tweaks to the measure line detection parameters.