added cluster factory and made implementations internal.