Improve character data rendering logic
Ensure local variables are accessible by their functions only