Cleans a little bit the rendering code