Cleanup LinesService and Python2.7 compatibility