generate and/or set ids