Added layout handling to renderer