refactored tabix into a separate function