Refactoring bitmap functions to a new compilation unit.