Major refactoring. Eliminated complex cache variations.