MasterBucket code cleaning