added Line abstraction and necessary changes in other classes