move multi node logic to standalone method