refactoring bitmap cache