Refactor Line type