clean up code of collective.hpp