optimized render method