refactoring for cluster

refactoring to support cluster diamond-server