Deletion of compartments

factorized Compartments into singleton w/ closure.