Refactor models to module