Optimized line splitting, turned out that 50% of the reading was spent in this function, now it is down to 25%.