removing uneeded code, cleaned up rendering and fixed caching