This is the example of the text which needs to be checked out:
A: Is he a student?
B: Yes, he studies at our university. He worked at our factory before he entered our university. Now he doesn't work.
Thus, I used worked instead of had worked. I did it because the process of working is a habitual, permanent state in the past and now it's not connected with the current situation: Now he doesn't work.
Since it's no longer valid I could use used to work as well as the above variant, but not Past Perfect.
As far as I understand, the process of entering the university is a reference time; some point or may be past time to which he worked at the factory.
So, am I right? Is my understanding of the case correct?