enabled redis caching; refactored and polished various things