RIFTSAW-523: clustering support. (still needs to be refined)