refactored bucket retrivel