We could have used its name directly, but we chose not to

We could have used its name directly, but we chose not to in order to make the code more independent and hopefully easier to port, in the future, to new projects using different models.

What about the sentence is it correct?

if correct then what does the above bold part suggest?

The sentence is grammatical, in my view; ’ but we chose not to’ indicates ’ but we did not use its name directly’.