Refactored Clusterer with generics to improve API