extracted local variables to avoid allocation on each call