Few refactorings of rendering loop core