Refactored mesh rendering