Refactor to allow multiple chains