Code refractoring: node, client