Move line processing into separate method.