Quickly modified to add split cache functionality.