Optimized auto generation and added addtional keys for index