add generation of random ids and extract setup script