Move SwB code out of Bucket