Refactor cache structs, also remove EOF check