refactored clusters and added tests for clusters namespace.