Optimized rendering: Moved all "new" operators outside of render loop for better memory performance