extracted from nuno's pattern of booting a node app