Minor improvements:

- append char instead of String
- do not calculate the idValue in a loop