bucket index refactored