refactor logic into the bridge itself