added a line reader and extracted interfaces out for files and lines