Added ability to change layout for renderToString