small refactoring of node and ruby