Some cleanup in viewmodel render code