[nit] my preference would be to create a new local var here and use that, since assigning local values to function input params can make debugging confusing sometimes.