Cluster RS and SH completed with tests and refactoring