adding cluster/state capability and unit tests