extracted build_buckets