line_type spec
line_type code & refactor main into module methods