avoid allocating unnecessary objects
reuse some arrays to avoid to reallocate them later