Add render and rebuild function