refactoring. readlines not included in timing