They use each other, there are static functions in the model which use the lib to get data, and functions in the lib which construct that data, so that's why you get a circular reference. I didn't find a prettier way of getting around it. Circular references are not evil as a concept, only if you misuse them.