refactor LineHandler