cleaner implementation of Line class using class extension and properties