Refactor common index file opening with BGZF into (private) shared function