Moved local variable declarations to inner-most scope to avoid object
creation overhead