Removed code duplication and changed hazelcast 3 version