Simplify the tile pattern parsing code.