Refactoring to facilitate different render modes in stardust editor.