refactoring after #1 - extracted Line class