refactor most of the linked pkg code into a seperate source file
make pattern translations also look at the linked packages