Refactor as a separate lib, make cluster layer class methods an extension.