refactor to readLine()