extract line handler to class