Refactor put_bucket to use formalize_bucket