- Restructure rendering code