fixed #2445 refactor code for rendering classes to optimize performance