simplifications

- `A` is only used once, so I'd suggest to use the native `Array` instead.
- `i` is defined in each method separately, no need to define it on constructor