somewhat better adapted for node.js