some optimizations to integer generation
some optimizations to integer generation