Wrapped up semi done TemplateRenderin and added Optimizations