[CHORE] Refactored lib to inject model as dependency instead of using require