private T General <T>(ImageProcessor <T> processor) { var chars = FileContents.ToCharArray(); const int width = 25; const int height = 6; const int layerSize = width * height; var layers = new ImageLayer[chars.Length / layerSize]; for (int i = 0; i < chars.Length; i += layerSize) { layers[i / layerSize] = new ImageLayer(chars, i, layerSize); } return(processor(layers)); }