Cleanup line parsing