Make use of scope to generate id