Line width and pattern matching cleanup