Added ID generation

Code clean-up