Extract local variable to avoid method call