moved cluster implementation to separate module