code to check each line outsourced to own method.