refactored cluster into library 'dock' class