Cache optimalizations (closes #30)