a bit of refectoring; node-ip added