seperate model and module factory